package bo;
import dao.*;
import java.io.*;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*/
public class Installer {
/**
 * @param database 
*/
public void run(DbHandler database) throws FileNotFoundException, IOException, Exception {
    BufferedReader buff = new BufferedReader(new FileReader("src\\resource\\insert_user_sp.sql"));
    String proc = "";
    while(buff.ready()) proc+=buff.readLine()+"\n";
    System.out.println("proc:"+proc);
    database.runSql(proc);
}
/**
 * @param args 
*/
public static void main(String[] args) throws Exception {
    DbHandler db = new DbHandler();
    db.setDbpath("C:\\Users\\Mendoza\\MooleInstaller\\server\\mysql\\bin\\");
    db.setHost("localhost");
    db.setPass("episunsa");
    db.setUser("root");
        try {
            new Installer().run(db);
        } catch (FileNotFoundException ex) {
            Logger.getLogger(Installer.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(Installer.class.getName()).log(Level.SEVERE, null, ex);
        }
}
}

